﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;

namespace SuperInterMarket
{
   public  class UtilTool
    {
        public static bool IsEmail(string str_Email)
        {

            string strRegex   =@"^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$";
            Regex   re   =   new   Regex(strRegex); 
            return re.IsMatch(str_Email);
            //return Regex.IsMatch(str_Email, @"^([/w-/.]+)@((/[[0-9]{1,3}/.[0-9] {1,3}/.[0-9]{1,3}/.)|(([/w-]+/.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(/)?]$");
        }

        public static bool IsNumber(string str_Number)
        {
            string pattern = @"^\d*$";
            return Regex.IsMatch(str_Number, pattern);
        }
    }
}
